package cn.kgm.makeGodV2.trigger;

import cn.kgm.makeGodV2.GamePlayer;
import cn.kgm.makeGodV2.WorldState;

/**
 * 位置触发器,根据位置触发事件
 *
 * @Version 1.8
 * @Author: Kappi
 * @Date: 2025-9-16 10:30
 * @Description: cn.kgm.makeGodV2.trigger.LocationTrigger
 */
public class LocationTrigger implements EventTrigger {

    private String locationId;

    public LocationTrigger(String locationId) {
        this.locationId = locationId;
    }

    /**
     * 判断npc是否在指定的位置
     *
     * @param npc        npc
     * @param worldState 世界状态
     * @return 玩家是否在世界状态内
     */
    @Override
    public boolean checkTrigger(GamePlayer npc, WorldState worldState) {
        return locationId.equals(npc.getCurrentLocation());
    }
}
